package com.starhub.dao.impl;

import java.util.List;

import org.hibernate.Session;

import com.starhub.dao.CategoryDao;
import com.starhub.dao.StarHubBaseDao;
import com.starhub.entity.Category;

public class CategoryDaoImpl extends StarHubBaseDao implements CategoryDao {

	public List<Category> getHeaderCategories() {
		Session session = sessionFactory.openSession();
		return session.createQuery("from Category where type = :type order by priority asc").setParameter("type", "header").list();
	}
	
	public List<Category> getFooterCategories() {
		Session session = sessionFactory.openSession();
		return session.createQuery("from Category where type = :type").setParameter("type", "footer").list();
	}
}
